One phase of the compilation process for a program written in a statically typed programming language is type checking, in which the compiler validates the correctness of expressions using information collected from type information in the program. This information can be obtained as a result of annotations associated with declarations of code elements, or information deduced by inference. Some compilers can use a code element that has a known type to deduce the type of another code element. This is called type inference.
In a language that features type inference, determining the type of a code element may require knowing the types of all other code elements in a program. This global approach to type inference can result in a computational cost that is quadratic with respect to the total number of declarations of code elements in a program. Any time the source code changes, the potential exists for the type of one or more code elements to change. Each key press may therefore precipitate a type checking operation designed to keep the IDE's understanding of the program's types current. The global approach to type inference can prove to be too computationally expensive in an interactive environment, such as in an IDE (interactive development environment) such as Eclipse or Microsoft's Visual Studio®.